import axios from '../config/axios'

export const register = (data) => {
  return axios({
    url: '/api/register',
    method: 'post',
    data
  }, true)
}

export const sign = (data) => {
  return axios({
    url: '/api/sign',
    method: 'post',
    data
  }, true)
}

export const login = (data) => {
  return axios({
    url: '/api/login',
    method: 'post',
    data
  })
}

export const vacation = (data) => {
  return axios({
    url: '/api/vacation',
    method: 'post',
    data
  })
}

export const get = (time) => {
  if (time) {
    return axios({
      url: `/api/get/${time}`,
      method: 'get'
    })
  }
  return axios({
    url: '/api/get',
    method: 'get'
  })
}

export const cancel = (id) => {
  return axios({
    url: `/api/cancelCheck?id=${id}`,
    method: 'get'
  })
}
